package com.insigma.business.qrcode.common.vo;

import java.util.LinkedHashMap;
import java.util.Map;


public enum QuerySortConEnum implements DescEnum {

    
    DESC("降序"),

    
    ASC("升序");

    
    private String desc;

    QuerySortConEnum(String desc) {
        this.desc = desc;
    }

    
    public static QuerySortConEnum getByEnumName(final String enumName) {
        for (QuerySortConEnum element : values()) {
            if (element.name().equals(enumName)) {
                return element;
            }
        }
        return ASC;
    }

    
    public static Map<String, String> getName2TitleMap() {

        Map<String, String> name2TitleMap = new LinkedHashMap<>();

        for (QuerySortConEnum element : values()) {
            name2TitleMap.put(element.name(), element.desc);
        }

        return name2TitleMap;
    }

    @Override
    public String getDesc() {
        return this.desc;
    }

}
